<?xml version='1.0' encoding='ISO-8859-1' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- 
	Bean.....: Questionario
	BeanClass: QuestionarioController
	Servlet..: 
	Descricao: Edicao do questionario
 -->
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:c="http://java.sun.com/jstl/core"
    xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
    xmlns:rich="http://richfaces.ajax4jsf.org/rich"
    xmlns:jopvl="http://net.sf.jOpinionPoll/validator"
    xmlns:jopcs="http://net.sf.jOpinionPoll/composition"
    xmlns:jopcc="http://net.sf.jOpinionPoll/tag/component/core">
    <ui:composition template="/pages/publico/template/default.xhtml">
        <ui:define name="titulo">
            <h:outputText value="#{msg['privado.questionario.manutencao.titulo']}" />
        </ui:define>
        <ui:define name="corpo">
            <f:view>
                <a4j:keepAlive beanName="Questionario"/>
                <jopcs:caixaMensagem />
                
                <!-- titulo -->
                <jopcc:simpleTitle text="#{msg['privado.questionario.manutencao.titulo']}" styleClass="boxTitulo" lineStyleClass="boxTituloLine" />
                
                <!-- lista -->
                <a4j:form id="formPadrao">
                    <table class="textoNormal" width="100%">
                        <tr align="left">
                            <td>
                                <h:outputLabel for="nome" value="#{msg['privado.questionario.manutencao.nome']}"/>
                                <span class="valorRequerido">*</span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <h:inputText id="nome"
                                             required="true"
                                             styleClass="texto"
                                             style="width:100%;"
                                             label="#{msg['privado.questionario.manutencao.nome']}"
                                             value="#{Questionario.questionario.nome}">
                                    <f:validateLength minimum="1" maximum="32"/>
                                </h:inputText>             
                            </td>
                        </tr>
                        <tr align="center">
                            <td colspan="2">
                                <h:message styleClass="valorRequerido" for="nome"/>
                            </td>
                        </tr>
                        <tr align="left">
                            <td colspan="2">
                                <h:outputText value="#{msg['privado.questionario.manutencao.descricao']}"/>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <h:inputTextarea id="descricao"
                                                 styleClass="texto"
                                                 style="width:100%;height:150px"
                                                 value="#{Questionario.questionario.descricao}">
									<f:validateLength minimum="0" maximum="255"/>
								</h:inputTextarea>
                            </td>
                        </tr>
                    </table>
                    <p/>
                    
                    <rich:separator height="2" width="100%" lineType="dotted" />
                    
                    <table class="textoNormal">
                        <tr align="right">
                            <td class="caixaTitulo">
                                <table>
                                    <tr>
                                        <td>
                                            <h:commandButton styleClass="button" actionListener="#{Questionario.salvarListener}" action="#{Questionario.salvarAction}" value="#{msg['comum.ok']}" />
                                        </td>
                                        <td>
                                            <h:commandButton styleClass="button" action="#{Questionario.listarQuestoesAction}" rendered="#{Questionario.questionario.id > 0}" value="#{msg['privado.questionario.manutencao.questoes']}">
                                            	<f:setPropertyActionListener target="#{Questao.questionario}" value="#{Questionario.questionario}" />
                                            </h:commandButton>
                                        </td>
                                        <td>
                                            <h:commandButton styleClass="button" action="CANCELED" immediate="true" value="#{msg['comum.cancelar']}"/>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </a4j:form>
            </f:view>
        </ui:define>
    </ui:composition>
</html>